package com.yonyou.pmclouds.industryandtype.rmiimpl;

import com.alibaba.dubbo.config.annotation.Service;
import com.yonyou.pmclouds.ApplicationConsts;
import com.yonyou.pmclouds.basecom.exception.BusinessException;
import com.yonyou.pmclouds.industryandtype.entity.TypeVO;
import com.yonyou.pmclouds.industryandtype.mapper.TypeMapper;
import com.yonyou.pmclouds.industryandtype.rmiitf.TypeQuery;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

@Slf4j
@Service(interfaceClass = TypeQuery.class, version = ApplicationConsts.APPLICATION_VERSION)
public class TypeQueryImpl implements TypeQuery {

    @Autowired
    private TypeMapper mapper;

    @Override
    public TypeVO[] queryTypeByIndustry(String[] pkIndustry, String billType) throws BusinessException {
        try {
            return mapper.getTypesByIndustry(pkIndustry, billType);
        } catch (Exception ex) {
            log.error(ex.getMessage(), ex);
            throw new BusinessException();
        }
    }
}
